<?php

namespace App\Model;

use Illuminate\Database\Eloquent\Model;

class Banner extends Model
{
    protected $table = 'banner';
    protected $guarded = [];

    /**
     * 获取首页轮播
     *
     * @param [type] $num
     * @return void
     * @Description
     * @example
     * @author AF
     * @since
     */
    public static function getHomeBanner($num)
    {
        $list   =   self::where('position',1)
        ->where('status',1)
        ->orderBy('created_at','desc')
        ->limit($num)
        ->get();
        return $list;
    }
}
